package com.aya.ite.itefinal;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.Map;

public class Waitress {
    private ArrayList<Menu> arrayList;

    public Waitress(ArrayList<Menu> arrayList) {
        this.arrayList = arrayList;
    }

    public void printMenu(){
       for(Menu menu:arrayList){
           printMenuItems(menu.createIterator());
       }
    }

    private void printMenuItems(Iterator<MenuItem> iterator) {
        while (iterator.hasNext()){
            MenuItem menuItem = iterator.next();
            System.out.print(menuItem.getName()+"\t");
            System.out.print(menuItem.getDescription()+"\t");
            System.out.print(menuItem.getPrice()+"\t");
            System.out.print(menuItem.getVegetarian()+"\n");
        }
    }
}
